/**
 * 贷款类型
 */
export enum ELOAN_TYPE {
  reducingBalance = '1',
  straightLine = '2',
}

/**
 * 付款类型
 */
export interface IRepaymentSchedule {
  // 还款日期
  repaymentDate: string;
  // 还款金额（月度）
  monthlyPayment: string;
  // 本月利息
  interestPayment: string;
  // 本月本金
  monthlyPrincipal: string;
  // 剩余本金
  remainingPrincipal: string;
}

/**
 * 计算器类型
 */
export interface ICalculatedResult {
  schedules: IRepaymentSchedule[];
}

export interface ICalculatorParams {
  principal: number;
  interestRate: number;
  loanTerm: number;
  repaymentDate: string;
}

export type ICalculator = (params: ICalculatorParams) => ICalculatedResult;
